<template>
    <div>
        <detail-header></detail-header>
        <detail-banner  :allData="allData" class="wrapper"></detail-banner>
        <detail-list :categoryList="categoryList"></detail-list>
    </div>
</template>
<script>
    // 引入
    import DetailHeader from '@/detail/components/detail-header'
    import DetailBanner from '@/detail/components/detail-banner'
    import DetailList from '@/detail/components/detail-list'
    import axios from 'axios'
    // 注册
    export default{
        name:"detail",
        data(){
        return{
            categoryList:[],
            allData:{}
        }
        },
        components:{
            DetailHeader,
            DetailBanner,
            DetailList
        },
        methods:{
            getDatailInfo(){
                axios.get("static/moke/detail.json",{
                    params:{
                        id:this.$route.params.id
                    }
                }).then(this.getSucc)
                console.log(this.$router.parms.id)
            },
            getSucc(res){
                let data=res.data;
                if(data.ret&&data.data){
                    this.categoryList=data.data.categoryList;
                    this.allData=data.data;
                }
            }
        },
        mounted(){
            this.getDatailInfo();
        }
    }
</script>
<style lang="stylus">
    .wrapper{
        height 800px
    }
</style>